package com.eonmind.common.contract.mail.templates;

public class MailHtmlTemplate {
    /**
     * 获取忘记密码验证码邮件模板
     *
     * @param username         用户名
     * @param verificationCode 验证码
     * @param validMinutes     有效分钟数
     * @return 邮件HTML内容
     */
    public static String getPasswordResetTemplate(String username, String verificationCode, int validMinutes) {
        return """
                <!DOCTYPE html>
                <html>
                <head>
                    <meta charset="UTF-8">
                    <meta name="viewport" content="width=device-width, initial-scale=1.0">
                    <title>密码重置验证码 - Eon-Mind-AI</title>
                    <style>
                        body {
                            font-family: 'Arial', sans-serif;
                            line-height: 1.6;
                            color: #333;
                            background-color: #f9f9f9;
                            margin: 0;
                            padding: 0;
                        }
                        .container {
                            max-width: 600px;
                            margin: 0 auto;
                            padding: 20px;
                            background: linear-gradient(145deg, #ffffff, #f0f0f0);
                            border-radius: 15px;
                            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
                        }
                        .header {
                            text-align: center;
                            padding: 20px 0;
                            border-bottom: 1px solid #eee;
                        }
                        .header img {
                            max-height: 60px;
                        }
                        .content {
                            padding: 30px 20px;
                        }
                        .verification-code {
                            font-size: 28px;
                            font-weight: bold;
                            text-align: center;
                            color: #3a7bd5;
                            background: linear-gradient(to right, #00c6ff, #0072ff);
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            margin: 25px 0;
                            letter-spacing: 5px;
                            padding: 15px;
                            border-radius: 8px;
                            border: 1px dashed #ccc;
                            background-color: rgba(240, 240, 240, 0.5);
                        }
                        .note {
                            font-size: 14px;
                            color: #777;
                            text-align: center;
                            margin-top: 20px;
                        }
                        .footer {
                            text-align: center;
                            padding-top: 20px;
                            font-size: 12px;
                            color: #999;
                            border-top: 1px solid #eee;
                        }
                        .button {
                            display: inline-block;
                            padding: 12px 24px;
                            background: linear-gradient(to right, #3a7bd5, #00d2ff);
                            color: white;
                            text-decoration: none;
                            border-radius: 5px;
                            font-weight: bold;
                            margin: 20px 0;
                            text-align: center;
                            transition: all 0.3s;
                            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
                        }
                        .button:hover {
                            transform: translateY(-2px);
                            box-shadow: 0 7px 20px rgba(0,0,0,0.2);
                        }
                        .highlight {
                            color: #3a7bd5;
                            font-weight: bold;
                        }
                    </style>
                </head>
                <body>
                    <div class="container">
                        <div class="header">
                            <h2 style="color: #3a7bd5;">Eon-Mind-AI</h2>
                        </div>
                        <div class="content">
                            <h2>密码重置</h2>
                            <p>尊敬的 <span class="highlight">%s</span>：</p>
                            <p>我们收到了您的密码重置请求。请使用以下验证码完成密码重置操作：</p>
                
                            <div class="verification-code">%s</div>
                
                            <p>该验证码将在 <span class="highlight">%d 分钟</span>内有效。如果您没有请求重置密码，请忽略此邮件。</p>
                
                            <p>为了保障您的账户安全，请勿将验证码分享给他人。</p>
                
                            <div class="note">
                                <p>此邮件由系统自动发送，请勿回复。</p>
                            </div>
                        </div>
                        <div class="footer">
                            <p>© %d Eon-Mind-AI. 保留所有权利。</p>
                            <p>Eon-Mind-AI - 智能，安全，为您的未来思考</p>
                        </div>
                    </div>
                </body>
                </html>
                """.formatted(username, verificationCode, validMinutes, java.time.Year.now().getValue());
    }

    /**
     * 获取注册验证码邮件模板
     *
     * @param username         用户名
     * @param verificationCode 验证码
     * @param validMinutes     有效分钟数
     * @return 邮件HTML内容
     */
    public static String getRegistrationTemplate(String username, String verificationCode, int validMinutes) {
        int currentYear = java.time.Year.now().getValue();

        return "<!DOCTYPE html>\n" +
                "<html>\n" +
                "<head>\n" +
                "    <meta charset=\"UTF-8\">\n" +
                "    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n" +
                "    <title>注册验证码 - Eon-Mind-AI</title>\n" +
                "    <style>\n" +
                "        body {\n" +
                "            font-family: 'Arial', sans-serif;\n" +
                "            line-height: 1.6;\n" +
                "            color: #333;\n" +
                "            background-color: #f9f9f9;\n" +
                "            margin: 0;\n" +
                "            padding: 0;\n" +
                "        }\n" +
                "        .container {\n" +
                "            max-width: 600px;\n" +
                "            margin: 0 auto;\n" +
                "            padding: 20px;\n" +
                "            background: #ffffff;\n" +
                "            border-radius: 15px;\n" +
                "            box-shadow: 0 10px 25px rgba(0,0,0,0.1);\n" +
                "            position: relative;\n" +
                "            overflow: hidden;\n" +
                "        }\n" +
                "        .header {\n" +
                "            text-align: center;\n" +
                "            padding: 25px 0;\n" +
                "            border-bottom: 3px solid #0072ff;\n" +
                "        }\n" +
                "        .logo-text {\n" +
                "            font-size: 28px;\n" +
                "            font-weight: bold;\n" +
                "            color: #0072ff;\n" +
                "            margin: 0;\n" +
                "        }\n" +
                "        .content {\n" +
                "            padding: 20px;\n" +
                "            background-color: #f8f9fa;\n" +
                "            border-radius: 10px;\n" +
                "            margin: 15px 0;\n" +
                "        }\n" +
                "        .verification-code {\n" +
                "            font-size: 32px;\n" +
                "            font-weight: bold;\n" +
                "            text-align: center;\n" +
                "            color: #3a7bd5;\n" +
                "            margin: 25px 0;\n" +
                "            letter-spacing: 8px;\n" +
                "            padding: 15px;\n" +
                "            border-radius: 8px;\n" +
                "            border: 1px dashed #0072ff;\n" +
                "        }\n" +
                "        .note {\n" +
                "            font-size: 14px;\n" +
                "            color: #666;\n" +
                "            text-align: center;\n" +
                "            margin-top: 20px;\n" +
                "            padding: 10px;\n" +
                "            background-color: #f0f4f8;\n" +
                "            border-radius: 5px;\n" +
                "        }\n" +
                "        .footer {\n" +
                "            text-align: center;\n" +
                "            padding-top: 20px;\n" +
                "            font-size: 12px;\n" +
                "            color: #999;\n" +
                "        }\n" +
                "        .highlight {\n" +
                "            color: #0072ff;\n" +
                "            font-weight: bold;\n" +
                "        }\n" +
                "    </style>\n" +
                "</head>\n" +
                "<body>\n" +
                "    <div class=\"container\">\n" +
                "        <div class=\"header\">\n" +
                "            <h1 class=\"logo-text\">Eon-Mind-AI</h1>\n" +
                "            <p style=\"margin-top: 5px; color: #666;\">未来智能，今日开启</p>\n" +
                "        </div>\n" +
                "        \n" +
                "        <div class=\"content\">\n" +
                "            <h2>欢迎加入 Eon-Mind-AI</h2>\n" +
                "            <p>亲爱的 <span class=\"highlight\">" + username + "</span>，</p>\n" +
                "            <p>感谢您注册 Eon-Mind-AI。我们很高兴您能加入我们的智能科技社区。请使用以下验证码完成注册流程：</p>\n" +
                "            \n" +
                "            <div class=\"verification-code\">" + verificationCode + "</div>\n" +
                "            \n" +
                "            <p>该验证码将在 <span class=\"highlight\">" + validMinutes + " 分钟</span>内有效。</p>\n" +
                "            \n" +
                "            <p>在 Eon-Mind-AI，我们致力于提供最前沿的人工智能解决方案，帮助您解锁无限可能。</p>\n" +
                "            \n" +
                "            <div class=\"note\">\n" +
                "                <p>为保障账户安全，请勿将验证码分享给他人。</p>\n" +
                "                <p>此邮件由系统自动发送，请勿回复。</p>\n" +
                "            </div>\n" +
                "        </div>\n" +
                "        \n" +
                "        <div class=\"footer\">\n" +
                "            <p>© " + currentYear + " Eon-Mind-AI. 保留所有权利。</p>\n" +
                "            <p>地址：科技创新中心，未来大道100号</p>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "</body>\n" +
                "</html>";
    }

}
